<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <input type="file" id="file" />
    <button id="btn">shangchuan</button>
    <script>
      let file = document.getElementById("file");
      let btn = document.getElementById("btn");
      file.onchange = function (e) {
        item = e.target.files[0];
        let blob = new Blob();

        console.log(item.slice(0, 32));
      };
      btn.onclick = function () {
        console.log(item);
        item
          .slice(0, 1)
          .arrayBuffer()
          .then(() => {
            console.log(1);
          })
          .catch(() => {
            console.log("文件被修改 了");
          });
      };
    </script>
  </body>
</html>
